package day01;

import java.io.*;

//class order{
//
//}

public class DataInputOutStreamDemo01 {
    public static void main(String[] args) throws IOException {
        DataOutputStream dout = new DataOutputStream(
                new FileOutputStream(
                        new File("d:\\1\\data.txt")));
        dout.writeInt(20);
        dout.writeBoolean(true);
        dout.writeChar('F');
        dout.flush();
        dout.close();
        DataInputStream din = new DataInputStream(
                new BufferedInputStream(
                        new FileInputStream(
                                new File("D:\\1\\data.txt"))));
        int age = din.readInt();
        boolean gender = din.readBoolean();
        char c = din.readChar();
        System.out.println("age="+age+",gender="+(gender?"男":"女")+",name="+c);
    }
}
